package com.donn.securitycontrolplatform.utils;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.time.temporal.TemporalAdjusters;

public class DateUtil {
    /**
     * 获取当月的第一天
     * @param count_date
     * @return
     */
    public static LocalDate monthOfFirstDate(LocalDate count_date) {
        LocalDate monthOfFirstDate = LocalDate.parse(count_date.toString(),
                DateTimeFormatter.ofPattern("yyyy-MM-dd")).with(TemporalAdjusters.firstDayOfMonth());
        return monthOfFirstDate;
    }

    public static void main(String[] args) {
        System.out.println(LocalDateTime.now().plusDays(-6));
    }
}
